Creating Data Definition Files

A data definition file is a tab-separated text file that contains information about field names, field types, and sample field data. Field names used in the data definition file must match the field names that will appear in the ActiveX data source that is specified at runtime. Field type information indicates the type of data in each field (string, numeric, date, etc.) and, if it is a string field, the maximum length of the string. Finally, sample field data is simply sample data that Crystal Reports can display in the preview window while you design the report.

For complete information on creating data definition files, see Creating Data Definition Files. Crystal Reports installs a sample data definition file in the \Program Files\Seagate Software\Crystal Reports directory on your system. This file is named ORDERS.TTX and can be used with the Orders table in the XTREME.MDB sample database or the Xtreme sample data ODBC data source that was created when you installed Crystal Reports.

The following is an example of how fields are defined in a data definition file:

Order ID            Long        1
Customer Name            String    50    Sample string value
Order Date            Date        Jan 5, 2000
Order Amount            Currency        $1.00

The Active Data Driver supports the following data types in a data definition file:

Data Type Description

BLOB

Fields that contain bitmap images.

Boolean

True/False Boolean value.

Byte

8-bit integer value.

Currency

64-bit floating-point value that can include a currency or percent sign.

Date

Any date/time value. Examples include:

  • Jan 5, 1999
  • 07/11/97 5:06:07
  • 07/11/97
  • 23:30:01

Long, int32

32-bit integer value.

Memo

Any string value over 254 characters long. You must indicate the maximum number of characters for the string.

Number

64-bit floating-point value.

Short, int16

16-bit integer value.

String

Any string value under 254 characters long, such as a name, description, or identification number that is not meant to be interpreted numerically. You must indicate the maximum number of characters for the string.

Note:     The data type BLOB is supported when connecting to RDO, ADO, DAO and the data control at runtime but not when connecting to CDO.

Although data definition files can be created manually using a text editor such as Notepad, Crystal Reports provides tools for simplifying the process. Each tool has its advantages. Review the process for using each tool described below to determine which best suits your own environment and development process.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com